home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / wx / py / pseudo.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  3KB  |  98 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
  5. __cvsid__ = '$Id: pseudo.py 25782 2004-02-13 02:47:59Z PKO $'
  6. __revision__ = '$Revision: 25782 $'[11:-2]
  7.  
  8. class PseudoKeyword:
  9.     
  10.     def __init__(self, method):
  11.         if callable(method):
  12.             self.method = method
  13.         else:
  14.             raise ValueError, 'method must be callable'
  15.  
  16.     
  17.     def __call__(self, *args, **kwds):
  18.         self.method(*args, **kwds)
  19.  
  20.     
  21.     def __repr__(self):
  22.         self()
  23.         return ''
  24.  
  25.  
  26.  
  27. class PseudoFile:
  28.     
  29.     def __init__(self):
  30.         pass
  31.  
  32.     
  33.     def readline(self):
  34.         pass
  35.  
  36.     
  37.     def write(self, s):
  38.         pass
  39.  
  40.     
  41.     def writelines(self, l):
  42.         map(self.write, l)
  43.  
  44.     
  45.     def flush(self):
  46.         pass
  47.  
  48.     
  49.     def isatty(self):
  50.         pass
  51.  
  52.  
  53.  
  54. class PseudoFileIn(PseudoFile):
  55.     
  56.     def __init__(self, readline, readlines = None):
  57.         if callable(readline):
  58.             self.readline = readline
  59.         else:
  60.             raise ValueError, 'readline must be callable'
  61.         if callable(readlines):
  62.             self.readlines = readlines
  63.         
  64.  
  65.     
  66.     def isatty(self):
  67.         return 1
  68.  
  69.  
  70.  
  71. class PseudoFileOut(PseudoFile):
  72.     
  73.     def __init__(self, write):
  74.         if callable(write):
  75.             self.write = write
  76.         else:
  77.             raise ValueError, 'write must be callable'
  78.  
  79.     
  80.     def isatty(self):
  81.         return 1
  82.  
  83.  
  84.  
  85. class PseudoFileErr(PseudoFile):
  86.     
  87.     def __init__(self, write):
  88.         if callable(write):
  89.             self.write = write
  90.         else:
  91.             raise ValueError, 'write must be callable'
  92.  
  93.     
  94.     def isatty(self):
  95.         return 1
  96.  
  97.  
  98.